<? 
$ratio = .3;
//$ratio = 1;


//$screenHeight= 
list($width, $bottomHeight, $type, $attr) = getimagesize(  site_url('public')."/images/www/device/".$DEV->d_imageDir."/".$DEV->d_imageDir."_bottom.png" );
list($topWidth, $topHeight, $type, $attr) = getimagesize(  site_url('public')."/images/www/device/".$DEV->d_imageDir."/".$DEV->d_imageDir."_top.png" );
list($width, $leftHeight, $type, $attr) = getimagesize(  site_url('public')."/images/www/device/".$DEV->d_imageDir."/".$DEV->d_imageDir."_left.png" );

$leftHeight = floor( $ratio * $leftHeight );
$topHeight = floor( $ratio * $topHeight );
$bottomHeight = floor( $ratio * $bottomHeight );
$topWidth = floor( $ratio * $topWidth );



$screenHeight= $leftHeight - $topHeight - $bottomHeight;

$topBarHeight = floor( $screenHeight * $DEV->d_topHeight / $DEV->d_height );
$coverFlowHeight = floor( $screenHeight * $DEV->d_coverHeight / $DEV->d_height );
$bottomBarHeight = $screenHeight - $topBarHeight - $coverFlowHeight;




$nameTmp = $DEV->d_name;
unset( $DEV->d_name );

$idTmp = $DEV->device_id;
unset( $DEV->device_id);

$dirTmp = $DEV->d_imageDir;
unset( $DEV->d_imageDir);
foreach( $DEV as $k=> $v ){
	$DEV->$k = round( $ratio * $v );
}
$DEV->d_name = $nameTmp;
$DEV->device_id = $idTmp;
$DEV->d_imageDir = $dirTmp;
?>
<div style="display:block;float:left;margin:50px" id=div_preview_<? echo $DEV->device_id ?> >
						
		<table cellspacing="0" cellpadding="0" border="0"	 >
			<TR>
				<TD rowspan=5 >
					<img border=0 src=<?php echo site_url('public')?>/images/www/device/<? echo $DEV->d_imageDir."/".$DEV->d_imageDir."_" ?>left.png  height=<? echo $leftHeight  ?>   />
				</TD>
				<td  >
					<img border=0 src=<?php echo site_url('public')?>/images/www/device/<? echo $DEV->d_imageDir."/".$DEV->d_imageDir."_" ?>top.png width=<? echo $topWidth  ?>   />
				</td>
				<TD rowspan=5>
					<img border=0 src=<?php echo site_url('public')?>/images/www/device/<? echo $DEV->d_imageDir."/".$DEV->d_imageDir."_" ?>right.png height=<? echo $leftHeight  ?>  />
				</TD>

			</tr>
			<tr>
				<td style="height:<? echo $topBarHeight ?>px" >
					<a class=TB_kitS href='#' 
							 >
						
						<table style="height:<? echo $topBarHeight ?>px;width:<? echo $topWidth ?>px" id=table_logo_TB_kitS  border=0 >
							<tr>
								<td id=td_TB_kitS_prev_left style="padding:0 30px 0 30px" valign=middle >
									<?
										


									?>									
									<img src=<?php echo site_url('public')?>/images/logo.gif   border=1 height=<? echo $topBarHeight * .6 ?> />
								</td>
							</tr>
						</table>
					</a>
				</td>
			</tr>
				
			<tr>
				<td style="height:<? echo $coverFlowHeight ?>px" >
					<a class=M_kitS href='#'  
				>
				 <?
				 /*
						echo  "leftHeight: ".$leftHeight."<BR />".
						
"topHeight: ".$topHeight."<BR />".
"bottomHeight: ".$bottomHeight."<BR />".

"screenHeight: ".$screenHeight."<BR />".
"topBarHeight: ".$topBarHeight."<BR />".
"coverFlowHeight: ".$coverFlowHeight."<BR />".
"bottomBarHeight: ".$bottomBarHeight."<BR />";
						
*/						
						
					?>
				</a>
				</td>
			</tr>
				
			<tr>
				<td style="height:<? echo $bottomBarHeight ?>px" >
					<a class=BB_kitS href='#'  
					
						
					>
						<table  style="height:<? echo $bottomBarHeight ?>px;width:<? echo $topWidth ?>px" border=0 >
							<tr>
							<?
							$bottomBarHeight;
							$butRefHeight = min( floor( .9 * .25 * $topWidth ) , $bottomBarHeight * .5 );
							
							
							?>
								<td width=25% align=center ><img id=but_refresh style="height:<? echo $butRefHeight ?>px" src="<?php echo site_url('public') . '/' .  
$PROJ->BB_RefButImg ?>" /></td>
								<td width=50% align=center ><img id=but_dl  style="height:<? echo $butRefHeight ?>px" src="<?php echo site_url('public') . '/' .  
$PROJ->BB_dlButImg ?>" /></td>
								<td width=25% align=center ><img id=but_info style="height:<? echo $butRefHeight ?>px" src="<?php echo site_url('public') . '/' .  
$PROJ->BB_InfoButImg ?>" /></td>

<!--							
								<td width=25% align=center ><img id=but_refresh width=50 src="images/button/refresh/download.jpg" /></td>
								<td width=50% align=center ><img id=but_dl width=150 src="images/button/dlRead/images.jpg" /></td>
								<td width=25% align=center ><img id=but_info width=50 src="images/button/info/download.jpg" /></td>
-->
							</tr>
						</table>
					</a>
				</TD>
			</tr>
			<tr  >
				<td   >
					<img border=0 src=<?php echo site_url('public')?>/images/www/device/<? echo $DEV->d_imageDir."/".$DEV->d_imageDir."_" ?>bottom.png width=<? echo $topWidth  ?>  />
				</td>
			</tr>
			<tr>
			<td colspan=3 align=center >
			<? echo $DEV->d_name ?>
			
			</tr>
	</Table>
				
				
			</div>